﻿using System;
using System.Collections.Generic;
using GeoAPI.Geometries;

namespace NetTopologySuite.Geometries.Utilities
{
	public class GeometryExtracter<T> : IGeometryFilter where T : IGeometry
	{
		public GeometryExtracter(IList<IGeometry> comps)
		{
			this._comps = comps;
		}

		public void Filter(IGeometry geom)
		{
			if (geom is T)
			{
				this._comps.Add((T)((object)geom));
			}
		}

		private readonly IList<IGeometry> _comps;
	}
}
